home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / ExtractComponent.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-01-18  |  1.5 KB  |  59 lines

  1. /********************************/
  2. /* Image Engineer Macro script  */
  3. /* by Simon Edwards             */
  4. /* 22/6/95                      */
  5. /*                              */
  6. /* 18/1/97 FORM interface added */
  7. /*                              */
  8. /* Extract a colour component   */
  9. /********************************/
  10.  
  11. Options results
  12. signal on error         /* Setup a place for errors to go */
  13.  
  14. if arg()==0 then exit
  15.  
  16. PROJECT_INFO arg(1) TYPE
  17. if RESULT~="COLOUR" then exit
  18.  
  19. 'FORM "Extract Colour Components" "Ok|Cancel"',
  20. ' TEXT,"Components to extract"',
  21. ' CHECKBOX,"Red",1',
  22. ' CHECKBOX,"Green",1',
  23. ' CHECKBOX,"Blue",1'
  24.  
  25. parse var result ok red green blue
  26. if ok=0 then exit
  27.  
  28. if red=1 then do
  29.     'BRIGHTNESS' arg(1) '-255 GREEN BLUE'
  30. end
  31.  
  32. if green=1 then do
  33.     'BRIGHTNESS' arg(1) '-255 RED BLUE'
  34. end
  35.  
  36. if blue=1 then do
  37.     'BRIGHTNESS' arg(1) '-255 RED GREEN'
  38. end
  39.  
  40. exit
  41.  
  42. /*******************************************************************/
  43. /* This is where control goes when an error code is returned by IE */
  44. /* It puts up a message saying what happened and on which line     */
  45. /*******************************************************************/
  46. error:
  47. if RC=5 then do         /* Did the user just cancel us? */
  48.     IE_TO_FRONT
  49.     LAST_ERROR
  50.     'REQUEST "'||RESULT||'"'
  51.     exit
  52. end
  53. else do
  54.     IE_TO_FRONT
  55.     LAST_ERROR
  56.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  57.     exit
  58. end
  59.